#!/usr/bin/bash

requested="$1"

[ "$requested" ] && p="$requested" || p="."

# p=${requested-"."}
# echo $p

find $p -type d -name Release -exec rm -rv {} \;
find $p -type d -name Debug -exec rm -rv {} \;

find $p -type f -iname '*\.plg' -exec rm -v {} \;
find $p -type f -iname '*\.ncb' -exec rm -v {} \;
find $p -type f -iname '*\.opt' -exec rm -v {} \;
find $p -type f -iname '*\.aps' -exec rm -v {} \;
find $p -type f -iname '*\.clw' -exec rm -v {} \;
find $p -type f -iname '*\.suo' -exec rm -v {} \;
find $p -type f -iname '*\.user' -exec rm -v {} \;

find $p -type f -iname build.txt              -exec rm -v {} \;
find $p -type f -iname CPP_grammar_.tokens    -exec rm -v {} \;
find $p -type f -iname 'CPP_grammar_Lexer.*'  -exec rm -v {} \;
find $p -type f -iname 'CPP_grammar_Parser.*' -exec rm -v {} \;
